package ro.sobis.repetor;

import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

public class ServerSuporteri implements Runnable {
	
	private Log log = LogFactory.getLog(ServerSuporteri.class);
	ServerSocket serverSocket = null;
	Thread t=null;
	int listenPort = 5000;
	
	public ServerSuporteri() throws IOException
	{
		serverSocket = new ServerSocket(listenPort);
		t= new Thread(this);
		t.start();
	}
	
	@Override
	public void run() {
		while(true)
		{
			try{
				Socket socketSuporter = serverSocket.accept();
				new InregistrareSuporter(socketSuporter);
			}
			catch(IOException e){
				log.error(e.getMessage());
			}
		}

	}

}
